package com.xuesheng.controller.front;


import com.xuesheng.entity.Chufen;
import com.xuesheng.entity.SysUser;
import com.xuesheng.entity.vo.ChufenVo;
import com.xuesheng.qpage.QPage;
import com.xuesheng.service.IChufenService;
import com.xuesheng.service.ISysUserService;
import com.xuesheng.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * <p>
 * 处分 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-04-19
 */
@Controller
@RequestMapping("/api/front/chufen")
public class AppChufenController {

    /**
     * 业务层
     */
    @Autowired
    private IChufenService service;

    @Autowired
    private ISysUserService iSysUserService;

    /**
     * 获取所有的列表
     * @return
     */
    @RequestMapping("/list")
    @ResponseBody
    public Result getList(QPage qPage, ChufenVo obj , HttpSession session) {
        SysUser sysUser=(SysUser) session.getAttribute("user");
        if(sysUser.getType().equals("3")){//3.学生
            obj.setUserid(sysUser.getUserid());
        }
        return Result.reOk("查询成功",this.service.getPageList(qPage,obj));
    }



}
